package com.bolingcavalry.rabbitmq;

import com.alibaba.fastjson.JSONObject;
import com.bolingcavalry.rabbitmq.model.SendModel;
import com.google.gson.JsonObject;
import com.winit.cloudlink.event.EventOperation;
import com.winit.cloudlink.message.Message;
import com.winit.cloudlink.message.handler.MessageHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * Created by wanglin on 2018/5/15.
 */
@Component
@Lazy(false)
public class TestListener implements MessageHandler<Message> {
    @Autowired
    private static Logger logger = LoggerFactory.getLogger(TestListener.class);
    @Value("${cloudlink.EventName}")
    private String EventName;
    @Override
    public String getMessageType() {
        return EventName;
    }

    @Override
    public void process(Message jsonObjectMessage) {
        JSONObject json = (JSONObject) jsonObjectMessage.getPayload();
        System.out.println(json);
    }
}